package com.aaa.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author sunshaoshan
 * @Title: GlobalCorsConfig
 * @ProjectName A340
 * @Description: 跨域配置
 * @date 2021/12/28 15:01
 */
@Configuration
public class GlobalCorsConfig  implements WebMvcConfigurer {
    @Override
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/**")
                .allowedOriginPatterns("*")
                .allowCredentials(false)
                .allowedMethods("GET","POST");
    }
}
